package com.dependencies.springjdbc.service;

import com.dependencies.springjdbc.dao.UserDao;
import com.dependencies.springjdbc.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhizhou   2024/7/29 23:29
 */
@Service
public class UserService {
    
    @Autowired
    private UserDao userDao;
    
    public List<User> findAll() {
        return userDao.findAll();
    }
    
    public User findById(int id) {
        return userDao.findById(id);
    }
    
    public int save(User user) {
        return userDao.save(user);
    }
    
    public int update(User user) {
        return userDao.update(user);
    }
    
    public int deleteById(int id) {
        return userDao.deleteById(id);
    }
}
